{{>licenseInfo}}
#ifndef {{prefix}}_{{classname}}_H
#define {{prefix}}_{{classname}}_H

#include "{{prefix}}HttpRequest.h"

{{#imports}}{{{import}}}
{{/imports}}

#include <QObject>

{{#cppNamespaceDeclarations}}
namespace {{this}} {
{{/cppNamespaceDeclarations}}

class {{classname}}: public QObject {
    Q_OBJECT

public:
    {{classname}}();
    {{classname}}(const QString& host, const QString& basePath, const int toutMs = 0);
    ~{{classname}}();

    void setBasePath(const QString& basePath);
    void setHost(const QString& host);
    void setApiTimeOutMs(const int tout);
    void setWorkingDirectory(const QString& path);
    void addHeaders(const QString& key, const QString& value);

    {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}const {{{dataType}}}& {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
    {{/operation}}{{/operations}}
private:
    QString basePath;
    QString host;
    QString workingDirectory;
    int timeout;
    QMap<QString, QString> defaultHeaders;
    {{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker);
    {{/operation}}{{/operations}}
signals:
    {{#operations}}{{#operation}}void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}});
    {{/operation}}{{/operations}}
    {{#operations}}{{#operation}}void {{nickname}}SignalFull({{prefix}}HttpRequestWorker* worker{{#returnType}}, {{{returnType}}} summary{{/returnType}});
    {{/operation}}{{/operations}}
    {{#operations}}{{#operation}}void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString error_str);
    {{/operation}}{{/operations}}
    {{#operations}}{{#operation}}void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
    {{/operation}}{{/operations}}
};

{{#cppNamespaceDeclarations}}
}
{{/cppNamespaceDeclarations}}
#endif
